const mongoose = require('mongoose');
const name = 'blog2';
const server = 'mongodb://127.0.0.1:27017/' + name;
console.log('server',server);
const config = {
    useNewUrlParser: true,
    useUnifiedTopology: true
}

var connect = mongoose.connect(server, config, function (err) {
    if (err) throw err;
    console.log('连接成功');
});

module.exports = connect;